﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EnumArray
{
    class Program
    {
        enum Seasons { Winter, Spring, Summer, Autumn }

        static void Main(string[] args)
        {
            // Source Array of Seasons Enum elements
            Seasons[] SeasonsArr = { Seasons.Winter, Seasons.Spring, Seasons.Summer, Seasons.Autumn};

            // Output Source Array into Console: Reversing Array
            Console.Write("Source Array: ");
            foreach (Seasons element in SeasonsArr)
            {
                Console.Write(element + " ");
            }

            // count of iteration for Reverse elements
            int size = SeasonsArr.Length / 2;
            // Buffer elements
            Seasons Buffer;
            // Reversing Array
            for (int i = 0; i < size; i++)
            {
                // Save First elements in Buffer
                Buffer = SeasonsArr[i];
                // Exchange First with Last elements
                SeasonsArr[i] = SeasonsArr[SeasonsArr.Length-i-1];
                // Change Last elements from Buffer
                SeasonsArr[SeasonsArr.Length-i-1] = Buffer;
            }
            Console.WriteLine();
            // Output Results into Console: Reversing Array
            Console.Write("Revers Array: ");
            foreach (Seasons element in SeasonsArr)
            {
                Console.Write(element+ " ");
            }
            Console.WriteLine();
            Console.ReadKey(true);
        }
    }
}
